﻿using System;
using System.Collections.Generic;
using System.Text;
using IRCServer.CommandHandlers;

namespace IRCServer.Entities.Commands
{
    class QUITCommand : IRCCommandBase
    {
        public QUITCommand(string message) :
            base(message)
        {
            string[] parameters = Utilities.CommandParser.GetParameters(message);

            if (parameters.Length > 1)
            {
                this.Message = parameters[1];
            }
        }

        public string Message { get; set; }

        public override string CommandName()
        {
            return "QUIT";
        }

        public override string ExecuteCommand(SessionBase session)
        {
            QUITCommandHandler handler = new QUITCommandHandler();
            return handler.HandleCommand(this, session);
        }
    }
}
